<?php
defined('BASEPATH') OR exit('No direct script access allowed');
//这个很强大，居然还可以分组，试了下好像可以改成ajax使用
$config = array(
    "signup"=>array(//$this->form_validation->run("signup")
        array(
            "field" => "username",
            "label" => "用户名",
            "rules" => array("required","min_length[5]","max_length[12]","is_unique[member.uname]",array(
                "username_check",
                function($str){
                    return $str=="yangzhouscy"?true:false;
                }
            )),
            "errors" => array(
                "username_check" => "{field}无法通过自定义验证username_check",
            )
        ),
        array(
            "field" => "password",
            "label" => "密码",
            "rules" => "required"
        ),
        array(
            "field" => "passconf",
            "label" => "确认密码",
            "rules" => "required|matches[password]"
        ),
        array(
            'field' => 'email',
            'label' => '邮箱',
            'rules' => 'required|valid_email'
        ),
    ),
);

$config['error_prefix'] = '<div class="alert alert-danger alert-dismissible"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>';
$config['error_suffix'] = '</div>';

?>